/*
* 组件：面包屑导航
* 接收props参数
* @params: params = {
              item_1：一级路径
              item_2: 二级路径
           }
*/
import Link from 'next/link';
import { Breadcrumb } from 'antd';

const MyBreadcrumb = ({ params = [] }) => {
    return (
        <div className="bread-crumb">
            <Breadcrumb>
                <Breadcrumb.Item>
                    <Link href="/"><a>首页</a></Link>
                </Breadcrumb.Item>
                {
                    params.map((item, index) => {
                        return (
                            <Breadcrumb.Item key={index}>
                                <Link href={item.url}><a>{item.name}</a></Link>
                            </Breadcrumb.Item>
                        )
                    })
                }
            </Breadcrumb>
        </div>
    )
}

export default MyBreadcrumb